package com.yinghuo.risk.frigate.generator;

import org.springframework.beans.factory.config.YamlMapFactoryBean;
import org.springframework.core.io.PathResource;

import java.util.Map;

/**
 * com.yinghuo.risk.frigate.generator
 *
 * @author 白雨浓
 * date: 2018/10/23 20:32
 * content:
 */
public class YmlReader {

    public Map<String, Object> read(String path) {

        YamlMapFactoryBean yaml = new YamlMapFactoryBean();

        yaml.setResources(new PathResource(path));

        return yaml.getObject();
    }

}
